<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试</title>
    <style>
        .d1{
            width: 500px;
            height: 500px;
            background-color: red;
        }
        .s1{
            width: 100%;
            height: 100px;
            background-color: blue;
        }
        .d2{
            width: 100VM;
            height: 500px;
            background-color: yellow;
        }
        .s2{
            width: 100%;
            height: 100px;
            background-color: green;
        }
    </style>
</head>
<body>
<div class="d1">
    <div class="s1"></div>
</div>
<div class="d2">
    <div class="s2"></div>
</div>
</body>
</html>